home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group94a.txt
/
000064_icon-group-sender _Fri Feb 25 08:49:50 1994.msg
< prev
next >
Wrap
Internet Message Format
|
1994-08-19
|
2KB
Received: by cheltenham.cs.arizona.edu; Fri, 25 Feb 1994 08:39:05 MST
Date: Fri, 25 Feb 1994 08:49:50 -0600 (CST)
From: Chris Tenaglia - 257-8765 <TENAGLIA@MIS.MCW.EDU>
Subject: kbhit(), getch(), read()
To: icon-group@cs.arizona.edu
Cc: icon-project@cs.arizona.edu
Message-Id: <01H9AODUV2SI8WWBLD@mis.mcw.edu>
Organization: Medical College of Wisconsin (Milwaukee, WI)
X-Vms-To: IN%"icon-group@cs.arizona.edu"
X-Vms-Cc: IN%"icon-project@cs.arizona.edu"
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-Transfer-Encoding: 7BIT
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
I wrote a nifty program in DOS Icon V8.10. It used kbhit(), getch(),
and read() in certain ways. This was to make an intuitive user interface.
Now for work I use Icon V8.10 on VAX/VMS 5.5. I hoped that the only
differences would be the fancy key strings and drawing characters.
However, the kbhit(), getch(), and read() work differently and the same
program user interface doesn't work well. Is it spelled out anywhere
what these behaviour differences are? I'd like to port to unix too,
except that getch() under ultrix doesn't work right either.
Under VMS if I don't use kbhit() and getch() and instead do all character
input using read() all behaves as expected. Once I start using them, it
seems that some characters overflow. So when I hit a read() from &stdin
the first character disappears as if a getch() somewhere else intercepted
it. Then when I terminate the read() by pressing <RETURN>, the <RETURN>
character gets intercepted by a kbhit()/getch() somewhere else, and this
causes strange behavior in a user interface. Is there a way to flush the
buffers at certain points and start fresh when needed? Has anyone else
encountered these alternate behaviours?
The best I could do for now is to emulate read() with a getch() loop,
but it too seems to pick up \r at random intervals. Does it matter that
I'm using ansi escape sequences to turn the cursor off and on where
appropriate?
Chris.